// index.js
// 获取应用实例
const app = getApp()
import {
  getCaVeueRentalObjPage
} from "../../../api/place.js";
Page({
  data: {
    camp:'',
option:0,
type:1,
id:1,
  },

  onChange(e) {
    const {
      index
    } = e.detail;

    // console.log(index);
  },
  // 事件处理函数
  bindViewTap() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
    go: function () {
      let id =  this.data.id
      id = JSON.stringify(id)
      let type=this.data.type;
      // let campid=this.data.campid
      let data={
        id:id,
        type:type,
        // campid:campid
      }
      data = JSON.stringify(data)
    wx.navigateTo({
      url: '../payment/payment?data='+data
    })
  },
  onLoad(options) {
    console.log(options)
    let data = JSON.parse(options.data);
    this.data.id = JSON.parse(data.id)

    this.getCaVeueRentalObjPage(data)
  },

  getCaVeueRentalObjPage(option) {
    let data ={
      "pageNum": "1",
      "pageSize": "10",
      "id": null,
      "caVenueRentalId": option.id,
      "veueRentalCode": option.name,
      "photoUrl": null,
      "price": null,
      "inventory": null,
      "transactionNum": null,
      "status": null,
      "delFlag": null,
      "createBy": null,
      "createTime": null,
      "updateBy": null,
      "updateTime": null,
      "remark": null
    }
    getCaVeueRentalObjPage(data).then(res => {
      let camp = res.data.data.records[0];
      // let camp = res.data.data.records[0].caCamp;

      console.log(camp);
      this.setData({
        camp: camp,
      })
    })
  },


  getprice(e) {
    let index = e.currentTarget.dataset.index;
    console.log(e);
    this.setData({
      index:index,
    })
  },
})